import { Provide } from "@midwayjs/decorator";
import { InjectEntityModel } from "@midwayjs/orm";
import { Repository } from "typeorm";
import { PhotoEntity } from "../entity/photo.entity";

@Provide()
export class PhotoService {
    @InjectEntityModel(PhotoEntity)
    photoEntity: Repository<PhotoEntity>

    async add(image: string) {
        return await this.photoEntity.insert({
            image
        })
    }
}